Skip to content

fix: perf + flicker in design app - #2622

Open
sidmohanty11 wants to merge 2 commits into
mainfrom
flicker-zoom
Open

fix: perf + flicker in design app#2622
sidmohanty11 wants to merge 2 commits into
mainfrom
flicker-zoom

Conversation

@sidmohanty11

Copy link
Copy Markdown
Contributor

A trackpad fires wheel events faster than the screen refreshes. Ten events between two frames would mean ten pointless transform writes, so events accumulate into a ref and rAF applies the latest value once per frame.

Previously, every scale change forced each screen to re-rasterise. Because all six screens are iframes (each its own document with its own render surface) the browser had to redraw all six from scratch on every tick. It couldn't finish inside the 16ms frame budget, so it shipped the frame unfinished, and the iframes drew nothing. That's the flicker, and it's why the surrounding editor chrome was half-painted too.

The filter/blur approach forces the browser to cache each iframe's pixels as a bitmap. While the gesture runs, a scale change stretches those bitmaps instead of redrawing. When the view settles, we drop the filter and take a single sharp re-raster.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@builder-io-integration builder-io-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builder reviewed your changes — looks good ✅

Review Details

Code Review Summary

PR #2622 optimizes multi-screen canvas zooming by coalescing camera updates, applying a compositor-friendly transient iframe filter during wheel gestures, and moving screen paint suppression out of React's render path. It also avoids redundant iframe content replacement after load and prevents opaque board previews from rendering for empty documents. The overall approach is sound: gesture-time DOM updates stay render-free, cleanup restores transient styles, and the new paint-suppression logic is covered by focused tests. The reviewed paths did not reveal a confirmed correctness, security, or performance regression.

Risk: Standard — this changes shared canvas state, culling, and iframe rendering behavior rather than only presentation styling.

Review outcome

  • ✅ Wheel gesture filtering is tracked and cleared on settle/cancel paths.
  • ✅ Paint suppression is synchronized with live camera movement and avoids React style ownership conflicts.
  • ✅ Board preview gating handles empty surface content.
  • ✅ Focused tests and template typecheck were reported passing by the review worker.

🧪 Browser testing: Will run after this review (PR touches UI code)

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Here's a visual recap of what changed:

Visual recap

Open the full interactive recap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants